<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <input type="button" value="点击" @click="doin(666,'ling')">
        <!-- 按回车键启动@keyup.enter -->
        <input type="text" @keyup.enter="ingg">
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {

            },
            methods: {
                doin: function(p1, p2) {
                    console.log('laotie');
                    console.log(p1);
                    console.log(p2);
                },
                ingg: function() {
                    alert('吃饭了吗')
                }
            }
        })
    </script>
</body>

</html>